﻿@using System.Collections.Generic
@using Microsoft.AspNetCore.Http
@using Microsoft.AspNetCore.Http.Authentication
@model Orchard.Users.ViewModels.LoginViewModel
@*@inject SignInManager<ApplicationUser> SignInManager*@

<div class="row">
    <div class="col-md-8">
        <section>
            <form asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
                <h4>@T["Use a local account to log in."]</h4>
                <hr />
                <div asp-validation-summary="All" class="text-danger"></div>
                <div class="form-group">
                    <label asp-for="UserName" class="col-md-3 control-label">@T["Username"]</label>
                    <div class="col-md-9">
                        <input asp-for="UserName" class="form-control" autofocus />
                        <span asp-validation-for="UserName" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label asp-for="Password" class="col-md-3 control-label">@T["Password"]</label>
                    <div class="col-md-9">
                        <input asp-for="Password" class="form-control" />
                        <span asp-validation-for="Password" class="text-danger"></span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-offset-3 col-md-9">
                        <div class="checkbox">
                            <label asp-for="RememberMe">
                                <input asp-for="RememberMe" />
                                @T["Remember me"]
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-offset-3 col-md-9">
                        <button type="submit" class="btn btn-default">@T["Log in"]</button>
                    </div>
                </div>
                <p>
                    <a asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]">@T["Register as a new user?"]</a>
                </p>
                @*<p>
                        <a asp-action="ForgotPassword">@T["Forgot your password?"]</a>
                    </p>*@
            </form>
        </section>
    </div>
    @*<div class="col-md-4">
            <section>
                <h4>Use another service to log in.</h4>
                <hr />
                @{
                    var loginProviders = SignInManager.GetExternalAuthenticationSchemes().ToList();
                    if (loginProviders.Count == 0)
                    {
                        <div>
                            <p>
                                There are no external authentication services configured. See <a href="http://go.microsoft.com/fwlink/?LinkID=532715">this article</a>
                                for details on setting up this ASP.NET application to support logging in via external services.
                            </p>
                        </div>
                    }
                    else
                    {
                        <form asp-controller="Account" asp-action="ExternalLogin" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
                            <div>
                                <p>
                                    @foreach (var provider in loginProviders)
                                    {
                                        <button type="submit" class="btn btn-default" name="provider" value="@provider.AuthenticationScheme" title="Log in using your @provider.DisplayName account">@provider.AuthenticationScheme</button>
                                    }
                                </p>
                            </div>
                        </form>
                    }
                }
            </section>
        </div>*@
</div>